{extend name="public/main" /}

{block name="body"}
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form action="{:request()->url()}" method="post" class="xn_ajax" data-type="open">
        <div class="layui-form-item">
            <label class="layui-form-label">上级用户组ID</label>
            <div class="layui-input-block">
                <select name="pid" lay-verify="required">
                    <option value="0">顶级用户组</option>
                    {foreach name="list" item="vo"}
                    <option value="{$vo.id}" {if condition="$pid eq $vo['id']"}selected{/if} >{$vo._name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户组名</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" placeholder="用户组名" autocomplete="off" class="layui-input" value="{$data.name?$data.name:''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">唯一标识</label>
            <div class="layui-input-block">
                <input type="text" name="group_name" lay-verify="required" placeholder="英文唯一标识 全小写 多值“_”隔开" autocomplete="off"   onkeyup="this.value=this.value.replace(/[^\w_]/g,'');" class="layui-input" value="{$data.group_name?$data.group_name:''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                {if !empty($data.status)}
                <input type="radio" name="status"  value="0"  title="失效"   {$data.status==0 ? 'checked':'' } >
                <input type="radio" name="status"  value="1"  title="有效"  {$data.status==1 ?  'checked':'' }>
                {else/}
                <input type="radio" name="status"  value="0"  title="失效" checked >
                <input type="radio" name="status"  value="1"  title="有效">
                {/if}
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
{/block}